﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BuffGenerate : MonoBehaviour {

    public TextAsset textAsset;

    public Dictionary<int, BuffData> buffDict = new Dictionary<int, BuffData>();

    private void Awake()
    {
        //GenerateBuff();
    }

    //生成BUFF
    public void GenerateBuff()
    {
        string[] lines = textAsset.text.Split("\n"[0]);

        foreach(string str in lines)
        {
            string[] s = str.Split(","[0]);
            BuffData bufData = new BuffData();
            bufData.Id = int.Parse(s[0]);
            bufData.Icon = s[1];
            switch (s[2])
            {
                case "attack":
                    bufData.BufType = BuffType.attack;
                    break;
                case "health":
                    bufData.BufType = BuffType.health;
                    break;
                case "speed":
                    bufData.BufType = BuffType.speed;
                    break;
            }
            bufData.Round = int.Parse(s[3]);

            buffDict.Add(bufData.Id, bufData);
        }
    }

}
